<div id="layout_main_top">

</div>
<div id="layout_main">

<DIV class="layout_large_table_top">

</DIV>
<DIV class="layout_large_table">
{if $smarty.session.level gte $USER_RIGHTS.user_change}
<script src="./includes/javascript/updateUser.js" type="text/javascript"></script>
{/if}
<table id="main_table" cellspacing='0' >
<tr class="menu_header">
	<th>#</th>
	<th>
		<a href="./index.php?page=standings&amp;sort=Rank" {popup text="Sort by user level"  center=#overlib_center# wrap=#overlib_wrap# offsety=#overlib_offsety# fgcolor=#overlib_fgcolor# bgcolor=#overlib_bgcolor#  textcolor=#overlib_textcolor#}>
			<img src="./images/buttons/rank.png" alt="" width="17" height="17" />
		</a>
	</th>
	<th align='left'>
		<a href="./index.php?page=standings&amp;sort=Class" {popup text="Sort by character Class"  center=#overlib_center# wrap=#overlib_wrap# offsety=#overlib_offsety# fgcolor=#overlib_fgcolor# bgcolor=#overlib_bgcolor#  textcolor=#overlib_textcolor#}>
			Name
		</a>
	</th>
	<th class="left">
		<a href="./index.php?page=standings&amp;sort=Name" {popup text="Sort by character Class" center=#overlib_center# wrap=#overlib_wrap# offsety=#overlib_offsety# fgcolor=#overlib_fgcolor# bgcolor=#overlib_bgcolor#  textcolor=#overlib_textcolor#}>
			Username
		</a>
	</th>
	<th>
		<a href="./index.php?page=standings&amp;sort=Race" {popup text="Sort by character Race"  center=#overlib_center# wrap=#overlib_wrap# offsety=#overlib_offsety# fgcolor=#overlib_fgcolor# bgcolor=#overlib_bgcolor#  textcolor=#overlib_textcolor#}>
			Email
		</a>
	</th>
	<th>
		<a href="./index.php?page=standings&amp;sort=Level" {popup text="Sort by character Level"  center=#overlib_center# wrap=#overlib_wrap# offsety=#overlib_offsety# fgcolor=#overlib_fgcolor# bgcolor=#overlib_bgcolor#  textcolor=#overlib_textcolor#}>
			Created
		</a>
	</th>
	{if $smarty.session.level gte $USER_RIGHTS.user_change}
	<th align='left'>
		<a href="#" {popup text="Admins functions"  center=#overlib_center# wrap=#overlib_wrap# offsety=#overlib_offsety# fgcolor=#overlib_fgcolor# bgcolor=#overlib_bgcolor#  textcolor=#overlib_textcolor#}>
			<img src="./images/buttons/admin.png" alt="" width="17" height="17" />
		</a>
	</th>
	{/if}
	{if $smarty.session.level gte $USER_RIGHTS.user_delete}
	<th align='left'>
		<a href="#" {popup text="Remove user"  center=#overlib_center# wrap=#overlib_wrap# offsety=#overlib_offsety# fgcolor=#overlib_fgcolor# bgcolor=#overlib_bgcolor#  textcolor=#overlib_textcolor#}>
			<img src="./images/buttons/delete.gif" alt="" width="17" height="17" />
		</a>
	</th>
	{/if}
	<th>
		&nbsp;
	</th>
</tr>

{foreach name=users item=single_user from=$users}


{if $smarty.session.uid eq $single_user.user_id}
	<tr class="row_3" id="user{$single_user.user_id}">
{else}
	<tr class="{cycle values="row_1,row_2" advance=true}" id="user{$single_user.user_id}">
{/if}
	<td>{$smarty.foreach.users.iteration}</td>

	<td>{$single_user.level}</td>
	<td align='left'>{$single_user.name}</td>
	<td align='left'>{$single_user.username}</td>
	<td align='left'>{$single_user.email}</td>
	<td align='left'>{$single_user.created_time}</td>

	{if $smarty.session.level gte $USER_RIGHTS.user_change}

	{assign var="name" value=$single_user.name}
	{assign var="script_location" value="1"}

	{include file='users_admin_edit.tpl' assign=editmenu}

	<td align='left'>
	<img src="./images/buttons/edit.gif" alt="" {popup trigger=OnClick sticky=yes caption=$name text=$editmenu closetext='X' fgcolor=#overlib_fgcolor# bgcolor=#overlib_bgcolor#  textcolor=#overlib_textcolor# height='0' wrap=no width='300'} />
	</td>
	{/if}
	{if $smarty.session.level gte $USER_RIGHTS.user_delete}
	<td align='left'>
	<img src="./images/buttons/delete.gif" alt="" onclick="javascript:deleteUser({$single_user.user_id}, 'admin_users')" />
	</td>
	{/if}
	<td></td>
</tr>

{foreachelse}
<tr class="{cycle values="row_1,row_2"}">
	<td colspan=15>No characters could be found.</td>
</tr>

{/foreach}

<tr class="{cycle values="row_1,row_2"}">
	<td colspan=16>
	</td>
</tr>

<tr class="{cycle values="row_1,row_2"}">
	<td colspan=16>

	</td>
</tr>

<tr class="menu_footer">
	<td colspan=16></td>
</tr>



</table>
</div>

<DIV class="layout_large_table_bottom">

</DIV>
</div>
<div id="layout_main_bottom">

</div>
